package snsdbook.engine.message;

import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import snsdbook.engine.FileManager;
import util.Util;

public class LoginReplyMessage implements MessageInterface {

  private static final long serialVersionUID = 3239353912619116461L;

  public LoginReplyMessage(String reply) {
    reply_ = reply;
  }

  @Override
  public String ProcessAsServer(ObjectInputStream is, ObjectOutputStream os) {
    Util.Send(os, this);
    return "";
  }

  @Override
  public String ProcessAsClient(ObjectInputStream is, ObjectOutputStream os,
                                FileManager manager) {
    return reply_;
  }
  
  @Override
  public String toString() {
    return "LOGIN REPLY MESSAGE, REPLY=" + reply_;
  }
  
  private String reply_;

}
